package com.eep.inventory;

import com.eep.common.Status;
import com.eep.data.DataService;
import java.util.ArrayList;
import java.util.List;
import com.eep.data.DataServiceImpl;
import com.eep.data.DatabaseName;

public class InventoryServiceImpl implements InventoryService {

    private DataService dataService = null;
    public InventoryServiceImpl() {
        dataService = new DataServiceImpl();
        dataService.createConnection(DatabaseName.Inventory);
    }

    public List<InventoryItem> getInventory(InventoryType inventoryType) {
        List<InventoryItem> iList = new ArrayList<InventoryItem>();

        switch (inventoryType) {
            case Trees: {
                iList = dataService.getTrees();
                break;
            }
            case Shrubs: {
                iList = dataService.getShrubs();
                break;
            }
            case Seeds: {
                iList = dataService.getSeeds();
                break;
            }
        }
        return iList;
    }

    public Status insertInventory(InventoryItem intentoryItem, InventoryType inventoryType) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
